package com.vito.demo.native.service

import com.vito.demo.native.dao.UserDao
import com.vito.demo.native.dao.UserRepository
import com.vito.demo.native.entity.User
import org.springframework.stereotype.Service
import javax.annotation.Resource
import javax.transaction.Transactional

/**
 * Created by lingzhiyuan.
 * Date : 2016/11/15.
 * Time : 19:02.
 * Description:
 *
 */

@Service
@Transactional
open class UserService {

    @Resource
    lateinit var userRepo: UserRepository
    @Resource
    lateinit var userDao: UserDao

    open fun findAll(): List<User>? = userDao.findAll(User::class.java)

    open fun findByName(name: String) = userRepo.findByName(name)

}